﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace com.orange.examination.Admin
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["admin"] == null)
            {
                Response.Redirect("../LoginAndRegister/Login.aspx");
            }
            else
            {
                lbuserID.Text = Session["admin"].ToString();
                MySqlConnection conn = BaseClass.DBCon();
                conn.Open();
                MySqlCommand cmd = new MySqlCommand("select AdminName from tb_Admin where AdminNum='" + lbuserID.Text + "'", conn);
                lbname.Text = cmd.ExecuteScalar().ToString();
                conn.Close();
            }
        }
    }
}